var findSubsequences = function(nums) {
  const ans = [], path = [];
  

  backtracking(0, nums, ans, path);

  return ans;

};
function backtracking(startIndex, nums, ans, path) {
  if (path.length > 1) {
    ans.push([...path]);
  }

  // 记录同层是否使用过该值
  const map = new Array(201).fill(0);

  for (let i = startIndex; i < nums.length; i++) {
    // 同层使用过这个数了
    if (map[nums[i] + 100] === 1) {
      continue;
    }
    // 判断当前nums[i]是否满足非递减 --- 不满足
    if (path.length !== 0 && path[path.length - 1] > nums[i]) {
      continue;
    }

    // 满足
    map[nums[i] + 100] = 1;
    path.push(nums[i]);
    backtracking(i+1, nums, ans, path);
    path.pop()
  }
}
const nums =  [4,6,7,7];
console.log(findSubsequences(nums))